<% Response.Buffer = True %> DUgallery 3.0
CATS KISSING DOGS
<% ' FileName="Connection_odbc_conn_dsn.htm" ' Type="ADO" ' HTTP="false" ' Catalog="" ' Schema="" MM_connDUgallery_STRING = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("_private\DUgallery.mdb") %> <% '**************************************************************************************** '** Copyright Notice '** Copyright 2003 DUware All Rights Reserved. '** This program is free software; you can modify (at your own risk) any part of it '** under the terms of the License that accompanies this software and use it both '** privately and commercially. '** All copyright notices must remain in tacked in the scripts and the '** outputted HTML. '** You may use parts of this program in your own private work, but you may NOT '** redistribute, repackage, or sell the whole or any part of this program even '** if it is modified or reverse engineered in whole or in part without express '** permission from the author. '** You may not pass the whole or any part of this application off as your own work. '** All links to DUware and powered by logo's must remain unchanged and in place '** and must remain visible when the pages are viewed unless permission is first granted '** by the copyright holder. '** This program is distributed in the hope that it will be useful, '** but WITHOUT ANY WARRANTY; without even the implied warranty of '** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR ANY OTHER '** WARRANTIES WHETHER EXPRESSED OR IMPLIED. '** No official support is available for this program but you may post support questions at: - '** http://www.duware.com/support '**************************************************************************************** %> <% set rsCount = Server.CreateObject("ADODB.Recordset") rsCount.ActiveConnection = MM_connDUgallery_STRING rsCount.Source = "SELECT (SELECT COUNT(*) FROM PICTURES WHERE PIC_APPROVED =1) AS PIC_COUNT, COUNT(*) AS TYPE_COUNT FROM TYPES" rsCount.CursorType = 0 rsCount.CursorLocation = 2 rsCount.LockType = 3 rsCount.Open() rsCount_numRows = 0 %>
There are <%=(rsCount.Fields.Item("PIC_COUNT").Value)%> pictures in <%=(rsCount.Fields.Item("TYPE_COUNT").Value)%> categories
<% rsCount.Close() %> <% ' FileName="Connection_odbc_conn_dsn.htm" ' Type="ADO" ' HTTP="false" ' Catalog="" ' Schema="" MM_connDUgallery_STRING = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("_private\DUgallery.mdb") %> <% '**************************************************************************************** '** Copyright Notice '** Copyright 2003 DUware All Rights Reserved. '** This program is free software; you can modify (at your own risk) any part of it '** under the terms of the License that accompanies this software and use it both '** privately and commercially. '** All copyright notices must remain in tacked in the scripts and the '** outputted HTML. '** You may use parts of this program in your own private work, but you may NOT '** redistribute, repackage, or sell the whole or any part of this program even '** if it is modified or reverse engineered in whole or in part without express '** permission from the author. '** You may not pass the whole or any part of this application off as your own work. '** All links to DUware and powered by logo's must remain unchanged and in place '** and must remain visible when the pages are viewed unless permission is first granted '** by the copyright holder. '** This program is distributed in the hope that it will be useful, '** but WITHOUT ANY WARRANTY; without even the implied warranty of '** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR ANY OTHER '** WARRANTIES WHETHER EXPRESSED OR IMPLIED. '** No official support is available for this program but you may post support questions at: - '** http://www.duware.com/support '**************************************************************************************** %> <% if(Request.QueryString("iPic") <> "") then cmdView__var_id = Request.QueryString("iPic") %> <% set cmdView = Server.CreateObject("ADODB.Command") cmdView.ActiveConnection = MM_connDUgallery_STRING cmdView.CommandText = "UPDATE PICTURES SET PIC_VIEW = PIC_VIEW + 1 WHERE PIC_ID = " + Replace(cmdView__var_id, "'", "''") + "" cmdView.CommandType = 1 cmdView.CommandTimeout = 0 cmdView.Prepared = true cmdView.Execute() %> <% Dim rsDetail__MMColParam rsDetail__MMColParam = "1" If (Request.QueryString("iPic") <> "") Then rsDetail__MMColParam = Request.QueryString("iPic") End If %> <% Dim rsDetail Dim rsDetail_numRows Set rsDetail = Server.CreateObject("ADODB.Recordset") rsDetail.ActiveConnection = MM_connDUgallery_STRING rsDetail.Source = "SELECT * FROM PICTURES, TYPES WHERE PIC_APPROVED = 1 AND PIC_TYPE = TYPE_ID AND PIC_ID = " + Replace(rsDetail__MMColParam, "'", "''") + "" rsDetail.CursorType = 0 rsDetail.CursorLocation = 2 rsDetail.LockType = 1 rsDetail.Open() rsDetail_numRows = 0 If rsDetail.EOF Then Response.Redirect("default.asp") %> <% Dim rsDetailPrev Dim rsDetailPrev_numRows Set rsDetailPrev = Server.CreateObject("ADODB.Recordset") rsDetailPrev.ActiveConnection = MM_connDUgallery_STRING rsDetailPrev.Source = "SELECT TOP 1 * FROM PICTURES WHERE PIC_APPROVED = 1 AND PIC_TYPE = " & Request.QueryString("iType") & " AND PIC_ID < " & Request.QueryString("iPic") & " ORDER BY PIC_ID DESC" rsDetailPrev.CursorType = 0 rsDetailPrev.CursorLocation = 2 rsDetailPrev.LockType = 1 rsDetailPrev.Open() rsDetailPrev_numRows = 0 %> <% Dim rsDetailNext Dim rsDetailNext_numRows Set rsDetailNext = Server.CreateObject("ADODB.Recordset") rsDetailNext.ActiveConnection = MM_connDUgallery_STRING rsDetailNext.Source = "SELECT TOP 1 * FROM PICTURES WHERE PIC_APPROVED = 1 AND PIC_TYPE = " & Request.QueryString("iType") & " AND PIC_ID > " & Request.QueryString("iPic") & " ORDER BY PIC_ID ASC" rsDetailNext.CursorType = 0 rsDetailNext.CursorLocation = 2 rsDetailNext.LockType = 1 rsDetailNext.Open() rsDetailNext_numRows = 0 %> <% Dim imgWidth, imgHeight, imgPercent, imgFixWidth, imgFixHeight imgWidth = rsDetail.Fields.Item("PIC_WIDTH").Value imgHeight = rsDetail.Fields.Item("PIC_HEIGHT").Value '** ERROR NEXT LINE If imgWidth > 580 Then imgFixWidth = 580 imgPercent = (imgFixWidth/imgWidth) imgFixHeight= (imgHeight*imgPercent) Else imgFixWidth = imgWidth imgFixHeight = imgHeight End If %>